<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionDispatch::Routing::Mapper</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionDispatch::Routing::Mapper 
            
                <span class="parent">&lt; 
                    
                    <a href="../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/actionpack/lib/action_dispatch/routing/mapper_rb.html">actionpack/lib/action_dispatch/routing/mapper.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  
    <!-- Namespace -->
    <div class="sectiontitle">Namespace</div>
    <ul>
      
        <li>
          <span class="type">MODULE</span>
          <a href="Mapper/Base.html">ActionDispatch::Routing::Mapper::Base</a>
        </li>
      
        <li>
          <span class="type">MODULE</span>
          <a href="Mapper/Concerns.html">ActionDispatch::Routing::Mapper::Concerns</a>
        </li>
      
        <li>
          <span class="type">MODULE</span>
          <a href="Mapper/HttpHelpers.html">ActionDispatch::Routing::Mapper::HttpHelpers</a>
        </li>
      
        <li>
          <span class="type">MODULE</span>
          <a href="Mapper/Resources.html">ActionDispatch::Routing::Mapper::Resources</a>
        </li>
      
        <li>
          <span class="type">MODULE</span>
          <a href="Mapper/Scoping.html">ActionDispatch::Routing::Mapper::Scoping</a>
        </li>
      
    </ul>
  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Mapper.html#method-c-normalize_name">normalize_name</a>,
              </li>
            
              
              <li>
                <a href="Mapper.html#method-c-normalize_path">normalize_path</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  
    <!-- Includes -->
    <div class="sectiontitle">Included Modules</div>
    <ul>
      
        <li>
          
            <a href="Mapper/Base.html">
              ActionDispatch::Routing::Mapper::Base
            </a>
          
        </li>
      
        <li>
          
            <a href="Mapper/HttpHelpers.html">
              ActionDispatch::Routing::Mapper::HttpHelpers
            </a>
          
        </li>
      
        <li>
          
            <a href="Redirection.html">
              ActionDispatch::Routing::Redirection
            </a>
          
        </li>
      
        <li>
          
            <a href="Mapper/Scoping.html">
              ActionDispatch::Routing::Mapper::Scoping
            </a>
          
        </li>
      
        <li>
          
            <a href="Mapper/Concerns.html">
              ActionDispatch::Routing::Mapper::Concerns
            </a>
          
        </li>
      
        <li>
          
            <a href="Mapper/Resources.html">
              ActionDispatch::Routing::Mapper::Resources
            </a>
          
        </li>
      
    </ul>
  



  

    

    

    
      <!-- Section constants -->
      <div class="sectiontitle">Constants</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class="attr-name">URL_OPTIONS</td>
            <td>=</td>
            <td class="attr-value">[:protocol, :subdomain, :domain, :host, :port]</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
          <tr valign='top'>
            <td class="attr-name">SCOPE_OPTIONS</td>
            <td>=</td>
            <td class="attr-value">[:path, :shallow_path, :as, :shallow_prefix, :module,
:controller, :action, :path_names, :constraints,
:shallow, :blocks, :defaults, :options]</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
      </table>
    


    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-normalize_name">
            
              <b>normalize_name</b>(name)
            
            <a href="Mapper.html#method-c-normalize_name" name="method-c-normalize_name" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-normalize_name_source')" id="l_method-c-normalize_name_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/29d5c2c7939f4e7d5fdb304e328626351c8ada68/actionpack/lib/action_dispatch/routing/mapper.rb#L311" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-normalize_name_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/mapper.rb, line 311</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">normalize_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">name</span>)[<span class="ruby-number">1</span><span class="ruby-operator">..</span><span class="ruby-number">-1</span>].<span class="ruby-identifier">tr</span>(<span class="ruby-string">&quot;/&quot;</span>, <span class="ruby-string">&quot;_&quot;</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-normalize_path">
            
              <b>normalize_path</b>(path)
            
            <a href="Mapper.html#method-c-normalize_path" name="method-c-normalize_path" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Invokes Journey::Router::Utils.normalize_path and ensure that (:locale)
becomes (/:locale) instead of /(:locale). Except for root cases, where the
latter is the correct one.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-normalize_path_source')" id="l_method-c-normalize_path_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/29d5c2c7939f4e7d5fdb304e328626351c8ada68/actionpack/lib/action_dispatch/routing/mapper.rb#L305" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-normalize_path_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/mapper.rb, line 305</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">path</span> = <span class="ruby-constant">Journey</span><span class="ruby-operator">::</span><span class="ruby-constant">Router</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">%r{/(\(+)/?}</span>, <span class="ruby-string">'\1/'</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r{^/\(+[^)]+\)$}</span>
  <span class="ruby-identifier">path</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                        </div>

    </div>
  </body>
</html>    